package com.tx.spring_security.spring_security_demo.util;

import org.springframework.security.crypto.password.PasswordEncoder;

/**
 *
 */
public class MercuryPasswordEncoder implements PasswordEncoder {

    @Override
    public String encode(CharSequence charSequence) {
        return MD5Util.encode((String) charSequence);
    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {
        return s.equals(MD5Util.encode((String) charSequence));
    }
}